package com.crr.common.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel(value = "分页参数")
public class PageQuery {
    @ApiModelProperty(name = "page",value = "用于记录当前第几页，默认第一页")
    int page;//用于记录当前第几页
    @ApiModelProperty(name = "pageSize",value = "每页的记录数，默认10条")
    int pageSize;//每页的记录数

    public int getPage() {
        if(page==0){
            return 1;
        }
        return page;
    }

    public void setPage(int page) {
        if(page<=0){
            this.page=1;
            return;
        }
        this.page = page;
    }

    public int getPageSize() {
        if(pageSize==0){
            return 10;
        }
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        if(pageSize<=0){
            this.pageSize=10;
            return;
        }
        this.pageSize = pageSize;
    }
}
